package tests;

import static org.junit.Assert.*;

import model.Park;
import model.Role;
import model.User;

import org.junit.Test;

/**
 * This class tests the non-trivial methods of the Park
 * class.
 * 
 * @author Ken Norton
 *
 */
public class ParkTest {

  /**
   * Tests the Constructor for the Park class.
   */
  @Test
  public void testConstructor() {
    Park park = new Park("Smith Park", "23 Main Method St",
        "Dist. 12", "NorthWest", new User("John",
        "john@smith.park.org", Role.PARK_MANAGER));
    
    assertEquals("Failed to construct Park", "Smith Park", 
        park.getName());
  }
  
  /**
   * Tests the equals method of the Park class with unequal
   * objects.
   */
  @Test
  public void testEqualsFalse() {
    Park park1 = new Park("Smith Park", "23 Main Method St",
        "Dist. 12", "NorthWest", new User("John",
        "john@smith.park.org", Role.PARK_MANAGER));
    
    Park park2 = new Park();
    
    assertFalse("Returned true with unequal objects.", 
        park1.equals(park2));
  }
  
  /**
   * Tests the equals method of the Park class with unequal
   * objects.
   */
  @Test
  public void testEqualsTrue() {
    Park park1 = new Park("Smith Park", "23 Main Method St",
        "Dist. 12", "NorthWest", new User("John",
        "john@smith.park.org", Role.PARK_MANAGER));

    assertTrue(".equals() returned false with two equal" +
    		" objects.", park1.equals(park1));
  }
}
